<script setup lang="ts">
import { defineProps } from 'vue';

// 定义 props
const props = defineProps({
  value1: {
    type: Number,
    default: 0
  }
});


import ProgressBar from 'primevue/progressbar';
import { ref, onMounted, onBeforeUnmount } from "vue";
// import { useToast } from "primevue/usetoast";

// onMounted(() => {
//     startProgress();
// });

// onBeforeUnmount(() => {
//     endProgress();
// });

// const toast = useToast();
// const value1 = ref(0);
const interval = ref();

// const startProgress = () => {
//     interval.value = setInterval(() => {
//         let newValue = value1.value + Math.floor(Math.random() * 10) + 1;
//         if (newValue >= 100) {
//             newValue = 100;
//             // toast.add({ severity: 'info', summary: 'Success', detail: 'Process Completed', life: 1000 });
//         }
//         value1.value = newValue;
//     }, 2000);
// };




// const endProgress = () => {
//     clearInterval(interval.value);
//     interval.value = null;
// };



</script>

<template>
    <!-- <Toast></Toast> -->
    <ProgressBar :value="props.value1" />
</template>

<style scoped></style>